﻿#ifndef HRIBBONSTACKEDWIDGET_H
#define HRIBBONSTACKEDWIDGET_H
#include <QStackedWidget>
#include "HRibbonGlobal.h"
class QHideEvent;
class QResizeEvent;
class HRibbonStackedWidgetPrivate;


/**
 * @brief 有qdialog功能的stackwidget，用于在最小化时stack能像dialog那样弹出来
 */
class HRIBBON_EXPORT HRibbonStackedWidget : public QStackedWidget
{
    Q_OBJECT
public:
    HRibbonStackedWidget(QWidget *parent);
    ~HRibbonStackedWidget();
    void setPopupMode();
    bool isPopupMode() const;
    void setNormalMode();
    bool isNormalMode() const;
    void exec();

    //设置stacked管理的窗口会随着stacked的大小变化而变化大小
    void setAutoResize(bool autoresize);
    bool isAutoResize() const;
    void moveWidget(int from, int to);

protected:
//    void mouseReleaseEvent(QMouseEvent *e);
    void hideEvent(QHideEvent *e) override;

signals:
    void hidWindow();

private:
    HRibbonStackedWidgetPrivate *m_d;
};

#endif // HRIBBONSTACKEDWIDGET_H
